layui.use('layer', function(){ //独立版的layer无需执行这一句
    var $ = layui.jquery, layer = layui.layer; //独立版的layer无需执行这一句
    //触发事件
    var active = {
        offset: function(){
            layer.open({
                title : false,
                type: 1
                ,content: '<div style="padding: 50px 50px;">'
                    +'<form class="layui-form layui-form-pane" lay-filter="example" method="post"  th:action="@{csnr2}">'
                    +'<div class="layui-form-item">'
                    +'<label class="layui-form-label layui-bg-green">充值金额：</label>'
                    +'<div class="layui-input-block">'
                    +'<input type="text" name="je" autocomplete="off" required="required" placeholder="请输入充值金额" class="layui-input">'
                    +'</div>'
                    +'</div>'
                    +'<button type="submit" name="bn" value="按钮2" class="layui-btn layui-btn-fluid">充值</button>'
                    +'</form>'
                    +'</div>'
                , closeBtn : 1
                ,btn: '取消'
                ,btnAlign: 'c' //按钮居中
                ,shade: 0.1 //显示遮罩
                ,yes: function(){
                    layer.close(layer.index);
                }
            });
        }
    };
    $('.cz').on('click', function(){
        var othis = $(this), method = othis.data('method');
        active[method] ? active[method].call(this, othis) : '';
    });
});